package com.redoor.app.stake.basicdata.timetask;

import com.redoor.app.stake.basicdata.service.SyncOrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 刷新redis长常量数据集合
 * Created by wangjunlei on 2018/3/16.
 */
@Configuration
@EnableScheduling
public class RedisRefreshSchedulingConfig {

    @Autowired
    private SyncOrganizationService syncOrganizationService;

    @Scheduled(cron = "0 0 3 * * ? ")
    public void refreshRedis() {
        syncOrganizationService.initOrganizationToRedis(true);
        syncOrganizationService.initDistrictIntoRedis(true);
    }
}
